ECMAScript is a standard script language derived largely from JavaScript, and is now widely used. A script is a program or sequence of instructions that is interpreted or executed by another program, as opposed to being compiled and executed directly by a computer processor. ECMAScript derives its name from the European Computer Manufacturer's Association, under whose auspices it was originally developed, and is used to affect how a Web application looks and behaves.
Current ECMAScript is a Java-like scripting language that contains rudimentary elements of object-oriented programming. ECMAScript is run as soon as it is loaded into a browser. If a script is not well-organized and refers to undefined symbols, however, a runtime error will result.
Current ECMAScript provides so-called “objects” and “prototypes.” Objects are the basic building blocks handled by programs written in ECMAScript, similar to objects in other object-oriented languages such as Java or Smalltalk. Prototypes are objects that can be used as blueprints for other objects. (In contrast to other object-oriented languages, where new objects are created by instantiating a class, in ECMAScript, new objects are generally created by cloning prototypes.) Objects are a collection of “properties.” A property has a name and a value. Property names are strings. Property values can be scalar values such as integers, floats, strings, arrays, objects, and functions. Function-valued properties have executable code as their value. Creating a new object not based on a prototype results in an object without any properties.
In an example, assume having an object O with a property p. The syntax for retrieving the value of property p is O.p. If O does not have a property with name p, the result of expression O.p is undefined. If the value of property p is a function, accessing the value of property p yields the function definition, which is a string. The syntax to execute the function definition stored in the value of property p is O.p(<parameters>), where <parameters> is a list of scalar values, arrays or objects, separated by commas. To add a new property q to an object O, assign a value to O.q. For example, assume an object O which does not have a property q. The statement O.q=“test” first adds the property q to object O, then assigns the value “test” to q. (If O already had a property q, no new property is added; only the value “test” is assigned to O.q.)
Prototypes are objects that can be used as blueprints for other objects. An object with name name can serve as a prototype, if it satisfies the following conditions:                There is a constructor method Name(<parameters>).        All properties p of the prototype are assigned to name.prototype.p, rather than to name.p.        
Then, it is possible to create objects based on the prototype object name by executing the code new Name(<parameters>).
When an object is created based on a prototype, a so-called dependent object is created. The dependent object initially has none of its own properties, but has a link to the prototype, called the prototype link. Via the prototype link, the dependent object inherits all properties from the prototype.
It is possible to add properties to the dependent object. Adding a property to a dependent object with a name different from the names of properties already defined at the prototype is called “extending the prototype”. In contrast, adding a property that has the same name as some other property already defined at the prototype is called “overwriting the property”.
Assume a prototype object P with properties p and q. Further, assume a dependent object O with a properties q and r. Property r of object O extends P, while property q of O overwrites property q of P.
An effect of the prototype link is that the semantics of property access change under certain circumstances: As usual, O.r yields the value of O.r. Also, O.q yields the value of O.q. However, rather than returning undefined, O.p results in the value of P.p: As property p is undefined at O, the property evaluation mechanism follows the prototype link to P and returns the results of the property evaluation at P.
A further effect of the prototype link is that changes to the prototype also affect all dependent objects. In more detail:                Changing the value of a property at the prototype will affect all dependent objects that have not overwritten the property.        Adding properties to, or removing properties from, the prototype affects all dependent objects that have not overwritten the property.        
Although the prototype mechanism provides basic functionality for object-oriented programming, current ECMAScript does not provide a mechanism for linking class objects once they are created and/or loaded into a hypertext markup language (HTML) page.